package com.lucene.service;

import com.lucene.mapper.ImageMapper;
import com.lucene.mapper.ProjectMapper;
import com.lucene.model.Image;
import com.lucene.model.Project;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zhangzhen on 25/10/2017.
 */
@Service("imageService")
public class ImageService {

    @Autowired
    private ImageMapper imageMapper;

    /**
     *
     * @return
     */
    public List<Image> getAllImages(){
        return imageMapper.getAllImages();
    }

    /**
     *
     * @param image
     * @return
     */
    public int addImages(Image image){
        return imageMapper.insertImage(image);
    }

    /**
     *
     * @param image
     * @return
     */
    public Image getImageBySrc(Image image){
        return imageMapper.searchBySrc(image);
    }
}
